home *** CD-ROM | disk | FTP | other *** search
/ How Many Bugs in a Box / How Many Bugs in a Box.cdr / bugs / act2 / 00462.ls < prev    next >
Encoding:
Text File  |  1995-03-28  |  1.9 KB  |  58 lines

  1. on sortthem
  2.   global athome, total
  3.   set reorg to 0
  4.   set total to 0
  5.   set trumpy to [[445, 186], [378, 142], [513, 135], [515, 249], [377, 249], [379, 198], [513, 195], [446, 136], [446, 228], [446, 272]]
  6.   updateStage()
  7.   set runny to [:]
  8.   set starty to [:]
  9.   repeat with xxx = 11 to 20
  10.     if sprite 3 intersects xxx then
  11.       set total to total + 1
  12.       put xxx
  13.       set grandma to []
  14.       add(grandma, the locH of sprite xxx)
  15.       add(grandma, the locV of sprite xxx)
  16.       addProp(starty, xxx, value(grandma))
  17.       set reorg to reorg + 1
  18.       set grampa to []
  19.       add(grampa, (getAt(getAt(trumpy, reorg), 1) - the locH of sprite xxx) / 30.0)
  20.       add(grampa, (getAt(getAt(trumpy, reorg), 2) - the locV of sprite xxx) / 30.0)
  21.       addProp(runny, xxx, value(grampa))
  22.     end if
  23.   end repeat
  24.   if count(runny) > 0 then
  25.     moveboxedones(starty, runny)
  26.   end if
  27.   updateStage()
  28. end
  29.  
  30. on moakelisterine
  31.   set lavoris to []
  32.   repeat with xxx = 11 to 20
  33.     add(lavoris, [the locH of sprite xxx, the locV of sprite xxx])
  34.   end repeat
  35.   put lavoris
  36. end
  37.  
  38. on moveboxedones istart, idone
  39.   set ptime to the timer
  40.   repeat while (the timer - ptime) < 30
  41.     set dtime to the timer - ptime
  42.     repeat with xxx = 1 to count(istart)
  43.       set newx to getAt(getAt(istart, xxx), 1) + (dtime * getAt(getAt(idone, xxx), 1))
  44.       set newy to getAt(getAt(istart, xxx), 2) + (dtime * getAt(getAt(idone, xxx), 2))
  45.       set the locH of sprite getPropAt(istart, xxx) to newx
  46.       set the locV of sprite getPropAt(istart, xxx) to newy
  47.     end repeat
  48.     updateStage()
  49.   end repeat
  50.   repeat with xxx = 1 to count(istart)
  51.     set newx to getAt(getAt(istart, xxx), 1) + (30 * getAt(getAt(idone, xxx), 1))
  52.     set newy to getAt(getAt(istart, xxx), 2) + (30 * getAt(getAt(idone, xxx), 2))
  53.     set the locH of sprite getPropAt(istart, xxx) to newx
  54.     set the locV of sprite getPropAt(istart, xxx) to newy
  55.   end repeat
  56.   updateStage()
  57. end
  58.